import { request } from '@umijs/max';
import api from '@/services/api';

export async function deviceList(params) {
  return request(api.device_list, {
    method: 'GET',
    params,
  });
}

export async function deviceDetail(params) {
  return request(api.device_detail, {
    method: 'GET',
    params,
  });
}

export async function deviceCreate(data) {
  return request(api.device_create, {
    method: 'POST',
    data,
  });
}

export async function deviceUpdate(data) {
  return request(api.device_update, {
    method: 'PUT',
    data,
  });
}

export async function deviceDelete(params) {
  return request(api.device_delete, {
    method: 'DELETE',
    params,
  });
}

export async function deviceStartup(params) {
  return request(api.device_startup, {
    method: 'GET',
    params,
  });
}

export async function deviceShutdown(params) {
  return request(api.device_shutdown, {
    method: 'GET',
    params,
  });
}

export async function deviceConfigSetting(data) {
  return request(api.device_config_setting, {
    method: 'POST',
    data,
  });
}

export async function deviceCommandSending(data) {
  return request(api.device_command_sending, {
    method: 'POST',
    data,
  });
}